﻿Imports BusinessLogicLayer

Partial Class MantServicicos
    Inherits System.Web.UI.Page


    Dim errores As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Cargargridview()
        End If
    End Sub

    Sub Cargargridview()

        'Hacemos una referencia a la clase
        Dim capanegocios As New ServicioBL
        Try
            'Invocamos al método ListarServicios definido previamente en la clase

            gvServicios.DataSource = capanegocios.ListarServicios
            gvServicios.DataBind()
        Catch ex As Exception
            errores = capanegocios.ChapaError
            Response.Redirect("Errores.aspx?id=" & errores)
        Finally
            'Liberamos recursos
            capanegocios = Nothing

        End Try
        
       

    End Sub
    Sub Cambiarpagina(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
        gvServicios.PageIndex = e.NewPageIndex
        Cargargridview()
    End Sub


End Class
